package com.zzf.sensitive.modules.dto;

import java.util.List;

/**
 * TODO
 *
 * @author zhangzhifu
 * @date 2021/1/15
 */
public class JsonResult<T> {
    public static final int OK = 200;
    public static final int FAIL = 404;
    public static final int NO_LOGIN = 501;
    private int code = 404;
    private T data;
    private List<?> list;
    private String message;

    public JsonResult() {
    }

    public JsonResult(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public List<?> getList() {
        return this.list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("JsonResult{");
        sb.append("code=").append(this.code);
        sb.append(", data=").append(this.data);
        sb.append(", list=").append(this.list);
        sb.append(", message='").append(this.message).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
